//
//  MyChatViewController.m
//  MyYiJianKangApp
//
//  Created by 张国文 on 16/4/6.
//  Copyright © 2016年 hangzhouyijiyin. All rights reserved.
//

#import "MyChatViewController.h"
#import "ChatRoomMemberViewController.h"

@interface MyChatViewController ()

@end

@implementation MyChatViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    // navi的修改
    [self changeNavigation];
}


// navi的修改
- (void)changeNavigation
{
    [self.navigationController.navigationBar setTranslucent:NO];
    self.navigationItem.title = self.title;
    UIImageView *leftImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
    leftImageView.image = [UIImage imageNamed:@"houtui"];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftImageView];
    UITapGestureRecognizer *leftTapGes = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(lastPage:)];
    [leftImageView addGestureRecognizer:leftTapGes];
    
    if (self.conversationType == ConversationType_CHATROOM) {
        UIBarButtonItem *rightItem = [[UIBarButtonItem alloc] initWithTitle:@"成员列表" style:UIBarButtonItemStyleDone target:self action:@selector(memberList:)];
        rightItem.tintColor = [UIColor whiteColor];
        self.navigationItem.rightBarButtonItem = rightItem;
    }
    
}

#pragma mark - 返回上一页面
- (void)lastPage:(UITapGestureRecognizer *)tapGes
{
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - 成员列表
- (void)memberList:(UIBarButtonItem *)barItem
{
    NSLog(@"成员列表");
    ChatRoomMemberViewController *chatRoomMemberVC = [[ChatRoomMemberViewController alloc] init];
    [self.navigationController pushViewController:chatRoomMemberVC animated:YES];
}







- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
